package practicedemo49;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        //1.键盘录入数据
        Scanner sc = new Scanner(System.in);
        String num = sc.next();
        if (num.length() > 9) {
            System.out.println("超过了9位");
            System.exit(-1);
        }
        for (int i = 0; i < num.length(); i++) {
            if (num.charAt(i) < '0' || num.charAt(i) > '9'){
                System.out.println("输入了不符合要求的字符");
                System.exit(-1);
            }
        }

        //创建一个罗马数字对应数组
        String[] arr = new String[]{"", "Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ"};
        //将对应数字转换为罗马数字
        StringBuilder sb = new StringBuilder();
        int index;
        for (int i = 0; i < num.length(); i++) {
            index = num.charAt(i) - '0';
            sb.append(arr[index]+"\t");
        }
        System.out.println(sb.toString());
    }
}
